<template>
  <van-sticky>
    <van-nav-bar :title="titleway" left-arrow @click-left="onClickLeft">
      <a :href="'tel:'+phoneNum" slot="right">
        <van-icon :name="phone" />
      </a>
    </van-nav-bar>
  </van-sticky>
</template>

<script>
import phone from "../../assets/img/phone.png";
export default {
  data() {
    return {
      phone,
      phoneNum: this.$store.state.nocaches.kefuphone
    };
  },
  computed: {
    titleway() {
      if (this.$route.query.type == 1 && this.$route.name == "qgList") {
        this.$route.meta.title = "我的求购";
      } else if (this.$route.query.type == 0 && this.$route.name == "qgList") {
        this.$route.meta.title = "我的供应";
      }
      return this.$route.meta.title || this.$route.query.menuname;
    }
  },
  methods: {
    onClickLeft() {
      this.$router.go(-1);
    }
  }
};
</script>

<style lang="less">
.van-nav-bar {
  background: #ffffff;
  .van-icon {
    color: #272937;
    font-size: 20px;
  }
  .van-nav-bar__text {
    color: #272937;
  }
}
</style>
